package org.hhchat.others.q360;

import java.util.*;

/**
 * Created this one by HMH on 2017/8/26.
 */
public class exam02 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());
        int [] num = new int[n];
        for(int i=0;i<n;i++){
            num[i] = scanner.nextInt();
        }

        for(int i=0;i<n;i++){
            System.out.print(getHigher(num,0,i,num[i]));
            if(i != n-1)
                System.out.print(" ");
        }
    }

    static TreeMap<Integer,Integer> map = new TreeMap<>();
    public static int getHigher(int[] a,int start,int end,int k){
        int count=0;
        Map.Entry<Integer, Integer> higher;
        Collection<Integer> submap = map.tailMap(k).values();
        for (Integer i : submap) {
            count += i;
        }
        Integer kq = map.get(k);
        if (kq == null) {
            kq = 0;
        }
        map.put(k, kq + 1);
        return count;
    }

}
